﻿function CommentsVm() {
    this.comments = ko.observableArray();
    
    this.loadJson = function (comments) {
        for (var idx = 0; idx < comments.length; idx++) {
            var commentVm = new CommentVm();
            commentVm.loadJson(comments[idx]);
            this.comments.push(commentVm);
        }
    }

    this.showPostLink = function (show) {
        for (var idx = 0; idx < this.comments().length; idx++) {
            commentVm = this.comments()[idx];
            commentVm.showPostLink(show);
        }
    }
}